Skip to content

add UserTotalSpent type#73

Merged
YouStillAlive merged 1 commit intomasterfrom
issue-71
Jul 10, 2025
Merged

add UserTotalSpent type#73
YouStillAlive merged 1 commit intomasterfrom
issue-71

Conversation

@YouStillAlive
Copy link
Member

closes #71

@YouStillAlive YouStillAlive requested a review from Copilot July 10, 2025 08:22
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds a new UserTotalSpent entity to track the cumulative amount each user has invested across all IDO pools. The implementation includes schema definition, entity management functions, and comprehensive test coverage.

Key changes:

  • Introduces UserTotalSpent entity with user address and total spent tracking
  • Integrates total spent tracking into the investment flow
  • Adds comprehensive tests for single and cross-IDO accumulation scenarios

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
schema.graphql Defines the new UserTotalSpent entity schema
src/extendedEntities/investProvider.ts Implements updateUserTotalSpent function for managing user spending totals
src/invest-provider.ts Integrates UserTotalSpent updates into the investment event handler
tests/invest-provider.test.ts Adds comprehensive test coverage for UserTotalSpent functionality

assert.fieldEquals("UserIDOInvestment", id, "blockTimestamp", "2000")

// Test UserTotalSpent accumulation across multiple investments
let userHex = "0x0000000000000000000000000000000000000002"
Copy link

Copilot AI Jul 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The hardcoded address string is duplicated from earlier in the test. Consider extracting this as a constant at the top of the test block to improve maintainability and reduce duplication.

Copilot uses AI. Check for mistakes.
@YouStillAlive YouStillAlive merged commit 5d4a7da into master Jul 10, 2025
1 check passed
@YouStillAlive YouStillAlive deleted the issue-71 branch July 10, 2025 08:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

add UserTotalSpent type

2 participants